const sqlFn = require('./mysql.js');

function generalQuery(tableName, params) {

    const sql = `select * from ${tableName} where concat(`devic`,`equipment_name`,`specification_and_model`) like  ${tableName}`;
    return new Promise((resolve, reject) => {
        sqlFn(sql, null, (result) => {
            if (result.length > 0) {
                resolve({
                    status: 200,
                    result
                });
            } else {
                reject({
                    status: 500,
                    msg: "暂无数据"
                });
            }
        });
    });
}
    
module.exports = {
    generalQuery,
   
};